package com.richinfo.ajax.server.config;

import javax.servlet.Filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.richinfo.ajax.server.filter.CrosFilter;

/**
 * Created by WangXJ
 * 2019-06-27 14:33
 */
//@Configuration
public class FilterConfig {

//	@Bean
	public FilterRegistrationBean<Filter> registerFilter(){	
		FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
		bean.addUrlPatterns("/*");
		bean.setFilter(new CrosFilter());
	
		return bean;
	}
}
